package com.lzj.demo.design.builder;

import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

@Slf4j
public class Test {
    //传统的if-else写法测试
   /* public static void main(String[] args) {
        MenuServiceImpl menuService = new MenuServiceImpl();
        log.info(menuService.getMatterList(new BigDecimal("132.52"),1));
        log.info(menuService.getMatterList(new BigDecimal("98.25"),2));
        log.info(menuService.getMatterList(new BigDecimal("85.43"),3));
    }*/
    //建造者模式写法测试
    public static void main(String[] args) {
        MenuDirector director = new MenuDirector();
        log.info(director.level1(new BigDecimal(132.52)).getDetail());
        log.info(director.level2(new BigDecimal(98.25)).getDetail());
        log.info(director.level3(new BigDecimal(85.43)).getDetail());
    }
}
